home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / shu194st.zoo / shellutils-1.9.4 / man / date.man < prev    next >
Encoding:
Text File  |  1994-03-16  |  5.4 KB  |  257 lines

  1.  
  2.  
  3.  
  4. DATE(1L)                         DATE(1L)
  5.  
  6.  
  7. N✓NA✓AM✓ME✓E
  8.        date - print or set the system date and time
  9.  
  10. S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
  11.        d✓da✓at✓te✓e  [-u] [-d datestr] [-s datestr] [--uct] [--universal]
  12.        [--date=datestr]     [--set=datestr]   [--help]   [--version]
  13.        [+FORMAT] [MMDDhhmm[[CC]YY][.ss]]
  14.  
  15.  
  16. D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
  17.        This  manual page documents the GNU version of d✓da✓at✓te✓e.  d✓da✓at✓te✓e
  18.        with no arguments prints    the current time and date (in the
  19.        format  of  the `%c' directive described    below).     If given
  20.        an argument that    starts with a `+', it prints the  current
  21.        time  and  date    in  a format controlled    by that    argument,
  22.        which has the same format as the    format string  passed  to
  23.        the `strftime' function.     Except    for directives that start
  24.        with `%', characters in that string are printed unchanged.
  25.  
  26.        The directives are:
  27.  
  28.        %      a    literal    %
  29.  
  30.        n      a    newline
  31.  
  32.        t      a    horizontal tab
  33.  
  34.        Time fields:
  35.  
  36.        %H     hour (00..23)
  37.  
  38.        %I     hour (01..12)
  39.  
  40.        %k     hour ( 0..23)
  41.  
  42.        %l     hour ( 1..12)
  43.  
  44.        %M     minute (00..59)
  45.  
  46.        %p     locale's AM or PM
  47.  
  48.        %r     time, 12-hour (hh:mm:ss [AP]M)
  49.  
  50.        %s     seconds  since 00:00:00, Jan 1, 1970 (a nonstandard
  51.           extension)
  52.  
  53.        %S     second (00..61)
  54.  
  55.        %T     time, 24-hour (hh:mm:ss)
  56.  
  57.        %X     locale's time representation (%H:%M:%S)
  58.  
  59.        %Z     time zone    (e.g., EDT), or    nothing    if no  time  zone
  60.           is determinable
  61.  
  62.  
  63.  
  64. FSF               GNU Shell Utilities            1
  65.  
  66.  
  67.  
  68. DATE(1L)                         DATE(1L)
  69.  
  70.  
  71.        Date fields:
  72.  
  73.        %a     locale's abbreviated weekday name    (Sun..Sat)
  74.  
  75.        %A     locale's    full  weekday name, variable length (Sun-
  76.           day..Saturday)
  77.  
  78.        %b     locale's abbreviated month name (Jan..Dec)
  79.  
  80.        %B     locale's full month  name,  variable  length  (Jan-
  81.           uary..December)
  82.  
  83.        %c     locale's    date  and  time     (Sat Nov 04 12:02:33 EST
  84.           1989)
  85.  
  86.        %d     day of month (01..31)
  87.  
  88.        %D     date (mm/dd/yy)
  89.  
  90.        %h     same as %b
  91.  
  92.        %j     day of year (001..366)
  93.  
  94.        %m     month (01..12)
  95.  
  96.        %U     week number of year with Sunday  as  first  day  of
  97.           week (00..53)
  98.  
  99.        %w     day of week (0..6) with 0    corresponding to Sunday
  100.  
  101.        %W     week  number  of    year  with Monday as first day of
  102.           week (00..53)
  103.  
  104.        %x     locale's date representation (mm/dd/yy)
  105.  
  106.        %y     last two digits of year (00..99)
  107.  
  108.        %Y     year (1970...)
  109.  
  110.        By default, d✓da✓at✓te✓e    pads numeric  fields  with  zeroes.   GNU
  111.        d✓da✓at✓te✓e  recognizes     the  following    nonstandard numeric modi-
  112.        fiers:
  113.  
  114.        -      (hyphen) do not pad the field
  115.  
  116.        _      (underscore) pad the field with spaces
  117.  
  118.        If given    an argument that does not start     with  `+',  d✓da✓at✓te✓e
  119.        sets  the  system  clock    to the time and    date specified by
  120.        that argument.  The argument must consist entirely of dig-
  121.        its, which have the following meaning:
  122.  
  123.        MM     month
  124.  
  125.  
  126.  
  127.  
  128. FSF               GNU Shell Utilities            2
  129.  
  130.  
  131.  
  132. DATE(1L)                         DATE(1L)
  133.  
  134.  
  135.        DD     day within month
  136.  
  137.        hh     hour
  138.  
  139.        mm     minute
  140.  
  141.        CC     first two    digits of year (optional)
  142.  
  143.        YY     last two digits of year (optional)
  144.  
  145.        ss     second (optional)
  146.  
  147.        Only the    superuser can set the system clock.
  148.  
  149.    O✓OP✓PT✓TI✓IO✓ON✓NS✓S
  150.        _✓-_✓d _✓d_✓a_✓t_✓e_✓s_✓t_✓r_✓, _✓-_✓-_✓d_✓a_✓t_✓e _✓d_✓a_✓t_✓e_✓s_✓t_✓r
  151.           Display  the  time  and  date specified in _✓d_✓a_✓t_✓e_✓s_✓t_✓r,
  152.           which can    be in almost any common    format.     The dis-
  153.           play  is    in  the     default  output format, or if an
  154.           argument starting    with `+' is given to d✓da✓at✓te✓e, in the
  155.           format specified by that argument.
  156.  
  157.        _✓-_✓-_✓h_✓e_✓l_✓p Print  a    usage message on standard output and exit
  158.           successfully.
  159.  
  160.        _✓-_✓s _✓d_✓a_✓t_✓e_✓s_✓t_✓r_✓, _✓-_✓-_✓s_✓e_✓t _✓d_✓a_✓t_✓e_✓s_✓t_✓r
  161.           Set the time and date to _✓d_✓a_✓t_✓e_✓s_✓t_✓r,    which can  be  in
  162.           almost  any  common  format.   It    can contain month
  163.           names, timezones,    `am' and `pm', etc.
  164.  
  165.        _✓-_✓u_✓, _✓-_✓-_✓u_✓n_✓i_✓v_✓e_✓r_✓s_✓a_✓l
  166.           Print or set the time and    date in    Universal Coordi-
  167.           nated  Time  (also  known     as  Greenwich Mean Time)
  168.           instead of in local (wall    clock) time.
  169.  
  170.        _✓-_✓-_✓v_✓e_✓r_✓s_✓i_✓o_✓n
  171.           Print version information    on standard  output  then
  172.           exit successfully.
  173.  
  174. E✓EX✓XA✓AM✓MP✓PL✓LE✓ES✓S
  175.        To print    the date of the    day before yesterday
  176.  
  177.           date --date '2 days ago'
  178.  
  179.        To  print  the  date  of     the day three months and one day
  180.        hence
  181.  
  182.           date --date '3 months 1 day'
  183.  
  184.        To print    the day    of year    of Christmas in    the current year
  185.  
  186.           date --date '25 Dec' +%j
  187.  
  188.        To print    the current date in a format including    the  full
  189.  
  190.  
  191.  
  192. FSF               GNU Shell Utilities            3
  193.  
  194.  
  195.  
  196. DATE(1L)                         DATE(1L)
  197.  
  198.  
  199.        month name and the day of the month
  200.  
  201.           date '+%B    %d'
  202.  
  203.        But  this  may  not be what you want because for    the first
  204.        nine days of the    month, the `%d'    expands    to a  zero-padded
  205.        two-digit field,    for example `date -d 1-may '+%B    %d'' will
  206.        print `May 01'.
  207.  
  208.        To print    the same date but without the  leading    zero  for
  209.        one-digit  days    of month, you can use the nonstandard `-'
  210.        modifier    to suppress the    padding    altogether.
  211.  
  212.           date -d 1-may '+%B %-d'
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256. FSF               GNU Shell Utilities            4
  257.